package com.cloud.pole.shop.biz.order;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.cloud.pole.common.biz.BaseBiz;
import com.cloud.pole.mapper.order.ShopOrderRefundImageMapper;
import com.cloud.pole.shop.model.entity.order.ShopOrderRefundDetail;
import com.cloud.pole.shop.model.entity.order.ShopOrderRefundImage;

import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;
/**
 * ${DESCRIPTION}
 *
 * @author wanghaobin
 * @create 2017-06-08 16:23
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ShopOrderRefundImageBiz extends BaseBiz<ShopOrderRefundImageMapper, ShopOrderRefundImage> {
	
	@Autowired
	ShopOrderRefundImageMapper shopOrderRefundImageMapper;
	

	@Override
    public void insertSelective(ShopOrderRefundImage entity) {
        super.insertSelective(entity);
    }
	
	public ShopOrderRefundImage selectByPrimaryKey(Long id) {
		return super.selectById(id);
	}
	
	public void updateSelectiveById(ShopOrderRefundImage entity) {
	       super.updateSelectiveById(entity);
	}

	public List<ShopOrderRefundImage> selectOrderRefundImageList(long refundId) {
		Example example = new Example(ShopOrderRefundDetail.class);
		 Criteria criteria = example.createCriteria();
		 criteria.andEqualTo("refundId", refundId);
		 example.setOrderByClause("image_id asc");
		 return selectByExample(example);
	}
}
